﻿@model RuleEngineRule
@using (Ajax.BeginForm("SaveRule", "Rules", new AjaxOptions()
{
    InsertionMode = InsertionMode.Replace, 
    UpdateTargetId = "middle-center",
    OnSuccess = "RuleAdded"
    
})) {
    @Html.ValidationSummary(true)
    <div class="form-container">
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.ChangeId)
        @Html.HiddenFor(model => model.ParentChangeId)
        @Html.HiddenFor(model => model.EffectiveDate)
        @Html.HiddenFor(model => model.RuleBookId)
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            Collection ( For Looping ):
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LoopContext)
            @Html.ValidationMessageFor(model => model.LoopContext)
        </div>
        @Html.HiddenFor(model => model.RuleExpression)
        <div>
            <input type="submit" value="Save" />
        </div>
    </div>
}